package com.flame.shapeville.component.task1.shape2D;

import javafx.scene.paint.Color;
import javafx.scene.shape.Shape;
import lombok.Getter;

/**
 * Abstract base class for all 2D shapes used in Task 1.
 * Provides common structure and styling functionality for rendering basic geometric shapes.
 *
 * @author Flame Dev Team
 * @version 1.0
 * @since 2025-05-12
 */
public abstract class JfShape2D {
    /**
     * The JavaFX shape object representing the visual geometry of this shape.
     */
    @Getter
    Shape shape;

    /**
     * The size (width/height) of the drawing area for this shape.
     */
    double size;

    /**
     * Initializes the shape with custom background, stroke color, and stroke width.
     *
     * @param background the fill color of the shape
     * @param strokeColor the outline color of the shape
     * @param strokeWidth the thickness of the shape's border
     */
    void initBaseParams(Color background, Color strokeColor, double strokeWidth) {
        shape.setFill(background);
        shape.setStroke(strokeColor);
        shape.setStrokeWidth(strokeWidth);
    }

    /**
     * Initializes the shape with default stroke settings (black, 2px).
     *
     * @param background the fill color of the shape
     */
    void initBaseParams(Color background) {
        initBaseParams(background, Color.BLACK, 2);
    }
}
